package com.itheima.advice;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Author: 徐林玉//作者及
 * @Date: 2021/9/26//完成日期
 * @Description: //
 * @Version: v0.0.1 // 版本信息
 * @Function List: // 主要函数及其功能
 * @Others: // 其它内容的说明
 * @History: // 历史修改记录
 **/

@ControllerAdvice
public class HandlerExceptionAdvice {



    @ExceptionHandler(AccessDeniedException.class)
    public String accessDeniedExceptionHandler(){

        return "redirect:/403.jsp";
    }


    @ExceptionHandler(RuntimeException.class)
    public String runtimeExceptionHandler(){

        return "redirect:/500.jsp";
    }

}
